<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>axios基本使用</title>
</head>

<body>

  <script src="./js/axios.min.js"></script>
  <script>
    // 请求超时
    axios.defaults.timeout = 5000

    axios.defaults.baseURL = 'http://localhost:3000'

    axios.defaults.headers['mytoken'] = 'hello';

    axios.get('axios-json').then(function (ret) {
      console.log(ret.data.uname)
    })


  </script>
</body>

</html>